<template>
    <div>
        <h2>子组件向父组件传值</h2>
        <button @click= 'sendMess'>点击子组件</button>
        <button @click= "$emit('dianBing')">点击放大</button>
    </div>
</template>

<script>
export default {
  data () {
    return {
      data1: {
        name: 'zi chuan fu',
        age: 123
      }
    }
  },
  methods: {
    sendMess () {
      this.$emit('childByValue', this.data1.name)
    }
  }
}
</script>
